.class public Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;
.super Ljava/lang/Object;


# instance fields
.field private currentNodeName:Ljava/lang/String;

.field private currentNodeValue:Ljava/lang/Object;

.field private currentSetterName:Ljava/lang/String;

.field initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

.field private objects:Ljava/util/List;


# direct methods
.method public constructor <init>(Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;Ljava/lang/String;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->objects:Ljava/util/List;

    iput-object p2, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentSetterName:Ljava/lang/String;

    return-void
.end method

.method private readChildren(Lorg/w3c/dom/Node;)V
    .locals 5

    invoke-interface {p1}, Lorg/w3c/dom/Node;->hasChildNodes()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    return-void

    :cond_1
    invoke-interface {p1}, Lorg/w3c/dom/Node;->getNodeName()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->setCurrentNodeName(Ljava/lang/String;)V

    invoke-interface {p1}, Lorg/w3c/dom/Node;->getChildNodes()Lorg/w3c/dom/NodeList;

    move-result-object v0

    const/4 v1, 0x0

    :goto_0
    invoke-interface {v0}, Lorg/w3c/dom/NodeList;->getLength()I

    move-result v2

    if-ge v1, v2, :cond_0

    invoke-interface {v0, v1}, Lorg/w3c/dom/NodeList;->item(I)Lorg/w3c/dom/Node;

    move-result-object v2

    invoke-interface {v2}, Lorg/w3c/dom/Node;->getNodeType()S

    move-result v3

    const/4 v4, 0x1

    if-ne v3, v4, :cond_5

    iget-object v3, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-interface {v2}, Lorg/w3c/dom/Node;->getNodeName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->getCollectionClass(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v3

    if-nez v3, :cond_2

    invoke-interface {v2}, Lorg/w3c/dom/Node;->getNodeName()Ljava/lang/String;

    move-result-object v0

    new-instance v1, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Class for "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " is not specified## Specify it using PojoXmlObj.addCollectionClass(\""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\","

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, ".class) method"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlException;-><init>(Ljava/lang/String;)V

    throw v1

    :cond_2
    invoke-interface {v2}, Lorg/w3c/dom/Node;->getChildNodes()Lorg/w3c/dom/NodeList;

    move-result-object v4

    invoke-interface {v4}, Lorg/w3c/dom/NodeList;->getLength()I

    move-result v4

    if-nez v4, :cond_4

    iget-object v2, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->objects:Ljava/util/List;

    const/4 v3, 0x0

    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_3
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_4
    iget-object v4, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v4, v2}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->setRootNode(Lorg/w3c/dom/Node;)V

    new-instance v2, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;

    iget-object v4, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-direct {v2, v3, v4}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;-><init>(Ljava/lang/Class;Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;)V

    invoke-virtual {v2}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToObjectProcessor;->getObject()Ljava/lang/Object;

    move-result-object v2

    iget-object v3, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->objects:Ljava/util/List;

    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1

    :cond_5
    invoke-interface {v2}, Lorg/w3c/dom/Node;->getNodeType()S

    move-result v3

    const/4 v4, 0x3

    if-ne v3, v4, :cond_3

    invoke-interface {v2}, Lorg/w3c/dom/Node;->getNodeValue()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, v2}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->setCurrentNodeValue(Ljava/lang/Object;)V

    goto :goto_1
.end method


# virtual methods
.method public getCurrentNodeName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentNodeName:Ljava/lang/String;

    return-object v0
.end method

.method public getCurrentNodeValue()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentNodeValue:Ljava/lang/Object;

    return-object v0
.end method

.method public getCurrentSetterName()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentSetterName:Ljava/lang/String;

    return-object v0
.end method

.method public processCollection()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->initInfo:Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/pojoxml/core/PojoXmlInitInfo;->getRootNode()Lorg/w3c/dom/Node;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->readChildren(Lorg/w3c/dom/Node;)V

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->objects:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->objects:Ljava/util/List;

    :goto_0
    return-object v0

    :cond_0
    invoke-virtual {p0}, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->getCurrentNodeValue()Ljava/lang/Object;

    move-result-object v0

    goto :goto_0
.end method

.method public setCurrentNodeName(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentNodeName:Ljava/lang/String;

    return-void
.end method

.method public setCurrentNodeValue(Ljava/lang/Object;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentNodeValue:Ljava/lang/Object;

    return-void
.end method

.method public setCurrentSetterName(Ljava/lang/String;)V
    .locals 0

    iput-object p1, p0, Lcom/wqmobile/sdk/pojoxml/core/processor/xmltopojo/dom/XmlToCollectionHandler;->currentSetterName:Ljava/lang/String;

    return-void
.end method
